package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.anno.RpcReference;
import com.lagou.rpc.pojo.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @RpcReference
    private IUserService userService;

    @RequestMapping("/getUser")
    public Object queryUserById(int id){
        User user = userService.getById(id);
        System.out.println(user);
        return user;
    }
}
